// 引入封装的 axios
import request from '@/utils/request'

// 获取-角色列表
export const getRoleListRequest = ({ page, pagesize }) => {
  return request.get('/sys/role', {
    params: {
      page,
      pagesize
    }
  })
}

// 删除角色：
export const delRoleRequest = id => request.delete(`/sys/role/${id}`)

// 新增角色
export const addRoleRequest = (addObj) => request.post('/sys/role', addObj)

// 获取角色，编辑时回显内容可用
export const getRoleDetailRequest = (id) => request.get(`/sys/role/${id}`)

// 修改角色
export const editRoleRequest = (editObj) => request.put(`/sys/role/${editObj.id}`, editObj)

// 给角色分配权限
export const assignRolePermissionRequest = (id, permIds) => request.put('/sys/role/assignPrem', { id, permIds })
